package scenes
{
   import flash.utils.getDefinitionByName;
   
   import jp.progression.casts.CastMovieClip;
   import jp.progression.commands.display.AddChild;
   import jp.progression.commands.display.RemoveChild;
   import jp.progression.scenes.SceneObject;

   /**
    * @author  cjboy1984@gmail.com
    */
   public class GenericScene extends SceneObject
   {
      private var page:CastMovieClip;

      /**
       * @param	name           Scene node name.
       * @param	castClass      Cast class name.
       * @param	initObject
       */
      public function GenericScene(name:String, castClass:String, initObject:Object = null)
      {
         super(name, initObject);

         var cls:Class = getDefinitionByName(castClass) as Class;
         page = new cls() as CastMovieClip;
      }

      // ################### protected ##################

      override protected function atSceneLoad():void
      {
         // tracking
         MyUtils.extCall('pv', 1);

         addCommand(
            new AddChild(container, page)
         );
      }

      override protected function atSceneUnload():void
      {
         addCommand(
            new RemoveChild(container, page)
         );
      }

      override protected function atSceneInit():void {}
      override protected function atSceneGoto():void {}
      override protected function atSceneAscend():void {}
      override protected function atSceneDescend():void {}

      // #################### private ###################

      // --------------------- LINE ---------------------

   }

}
